package com.crc.luojian.service;

import com.crc.luojian.annotation.Autowired;
import com.crc.luojian.annotation.Service;
import com.crc.luojian.annotation.Transactional;
import com.crc.luojian.component.TransactionManager;
import com.crc.luojian.util.ConnectionUtils;
import com.crc.luojian.util.DBUtil;

import java.sql.SQLException;

/**
 * @program: luojian-springframework
 * @description:
 * @author: luojian58
 * @create: 2021-06-11 14:10
 */
@Service
public class AService {
    @Autowired
    private BService bService;

    @Transactional(rollbackFor = {ArithmeticException.class})
    public String getById() throws SQLException {
        ConnectionUtils.executeUpdate("update test_custom set id="+333+" where id=1");
        int j =1/0;
       return  "1";
    }
}
